-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indicator data input #245
Indicator data input #245
Conversation
c8bdc53
to
eca4957
Compare
4b3e6fa
to
eca4957
Compare
1d776bf
to
05e75e5
Compare
1e89d10
to
c8e2f11
Compare
c8e2f11
to
9123f87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First overview looks pretty good, but one question we have to clarify before it makes sense to review in more detail: Does it make sense to name the new parameter layer
? I would assume it means the layer name and not layer data you can give the endpoint for calculation.
d393b69
to
711f7b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally not really of using **_kargs
or *_args
, especially if you don't use them. Isn't there a better solution?
workers/ohsome_quality_analyst/indicators/mapping_saturation/indicator.py
Outdated
Show resolved
Hide resolved
workers/tests/integrationtests/test_api_indicator_geojson_io.py
Outdated
Show resolved
Hide resolved
06ac588
to
ce5c6b4
Compare
Those are used because of flags like the E.g. Notice the different second arguments: @create_indicator_as_geojson.register(IndicatorBpolys)
@create_indicator_as_geojson.register(IndicatorData)
async def _create_indicator_as_geojson(
parameters: Union[IndicatorBpolys, IndicatorData],
size_restriction: bool = False,
**_kargs,
):
pass
@create_indicator_as_geojson.register
async def _create_indicator_as_geojson(
parameters: IndicatorDatabase,
force: bool = False,
**_kargs,
):
pass I am totally open for another solution. PS: The caller of the function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. Made only a few comments. If you want you can have a look at SonarCloud: https://sonarcloud.io/summary/new_code?id=ohsome-quality-analyst&pullRequest=245
32c23b9
to
b818b41
Compare
attached to itself. Factor out the layer classes from `base/indicator.py` to own module.
Instead of initializing an Indicator with a `layer_name` as string initialize an Indicator with a `layer` as Layer object.
Also first instantiate a Layer object and then pass it as init parameter to the Indicator object.
instead of making a request to the ohsome API to retrieve data Call ohsome.query function with args not kwargs.
Make usage of singledispatch more concise. Address review comments of the dispatch functions: - Adhere to convention to name overloaded func '_' - Remove # noqa comments - Rename 'kargs' to 'kwargs' - Add test cases for generic functions covering 'NotImplemented'
Ignore duplications in the tests fixtures.py Fix timestamp range in test fixtures Avoid loading the same fixture for each test case In test do not use empty string for layer name
b818b41
to
b1ea2e4
Compare
of the API instead of using empty strings.
Description
An Indicator consists of a Layer and a Feature.
This PR introduces a new Layer baseclass. Now a Layer object can be either an instance of a "Layer Definition" class (with information how to retrieve the data for the layer) or of a "Layer Data" class (with data already attached to itself). This way it is possible to compute an Indicator for given data. At the moment this is restricted to the MappingSaturation Indicator.
In particular the PR adds:
layer
(containing name, description and data) to the endpointindicator
(POST)Below is an example of the request body for a POST request to the
/indicator
endpoint.Corresponding issue
Closes #233
Checklist
main
(e.g. throughgit rebase main
)singledispatch
forcreate_indicator()
func of theoqt.py
module #239schema
from dev-dependency to depedency